<template>
	<view>
		<u-popup :show="popup_show" mode="center" :safeAreaInsetBottom="false" :mask-close-able="false" round="15" :custom-style="{'margin-bottom':'50rpx'}">
			<view class="popup">
				<view class="popup-wrap">
					<text class="title">提示</text>
					<text class="content">{{content}}</text>
					<view class="btn-view">
						<text class="btn-text center btn-text-cancel" @tap="cancel">{{cancel_text || '取消'}}</text>
						<text class="btn-text center btn-text-confirm" @tap="confirm">{{confirm_text || '确认'}}</text>
					</view>

				</view>
			</view>
		</u-popup>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		props: {

			content: {
				default: ""
			},
			cancel_text: {
				type: String,
				default: ""
			},
			confirm_text: {
				type: String,
				default: ""
			},
		},
		data() {
			return {
				popup_show: false,
				confirm_btn: ""
			};
		},

		methods: {
			show() {
				this.popup_show = true
			},
			confirm() {
				this.popup_show = false
				this.$emit('confirm')
			},
			cancel() {
				this.popup_show = false
				this.$emit('cancel')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.popup {
		width: 600rpx;
	}

	.popup-wrap {
		background-color: #ffffff;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		border-radius: 20rpx;
		padding: 0 42rpx;

		.title {
			padding: 32rpx 0;
			text-align: center;
			color: #333333;
			font-size: 32rpx;
		}

		.content {
			text-align: center;
			padding: 0rpx 30rpx;
			color: #333333;
			font-size: 32rpx;
			line-height: 50rpx;
		}

		.btn-view {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 40rpx 0 30rpx;

			.btn-text {
				color: #55C29A;
				font-size: 28rpx;
				height: 76rpx;
				line-height: 76rpx;
				width: 240rpx;
				border-radius: 100px;
				border: 1px solid #55C29A;
			}

			.btn-text-confirm {
				color: #ffffff;
				border: 1px solid #55C29A;
				background-color: #55C29A;
			}

		}
	}
</style>